/*****************************************************************************
 * Open MCT, Copyright (c) 2014-2016, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * Open MCT includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/
.section-header {
    text-transform: uppercase;
}

.form {
	color: $colorFormText;
    height: 100%;
    width: 100%;

    .l-form-section {
        position: relative;
        &.grows {
            .l-section-body,
            .form-row {
                @include flex(1 1 auto);
                .wrapper {
                    height: 100%;
                }
            }
        }
    }

    .section-header {
        border-radius: $basicCr;
        background: $colorFormSectionHeader;
        $c: lighten($colorBodyFg, 20%);
        color: $c;
        font-size: 0.8em;
        padding: $formTBPad $formLRPad;
    }

	.form-row {
		$m: $interiorMargin;
		box-sizing: border-box;
		border-top: 1px solid $colorFormLines;
        margin-bottom: $interiorMarginLg * 2;
		padding: $formTBPad 0;
		position: relative;
        //&ng-form {
        //    display: block;
        //}

		&.first {
			border-top: none;
		}

		>.label,
		>.controls {
			box-sizing: border-box;
			font-size: 0.8rem;
		}

		>.label {
			// Only style this way for immediate children of .form-row; prevents problems when .label is used in .controls section of a form
			min-width: 120px;
            order: 1;
            position: relative;
			white-space: nowrap;
			width: $formLabelW;
		}

		.value {
			color: $colorInputFg;
		}

		.controls {
            order: 2;
            position: relative;
            @include flex(1 1 auto);

			.l-composite-control {
				&.l-checkbox {
					display: inline-block;
					line-height: $formRowCtrlsH;
					margin-right: 5px;
				}
			}
			.select {
				margin-right: $interiorMargin;
			}
		}

		.hint, .field-hints {  color: $colorFieldHint;  }

		.selector-list {
			// Used in create overlay to display tree view
			@include nice-input();
            padding: $interiorMargin;
			position: relative;
            min-height: 150px;
			height: 100%;
			>.wrapper {
				$p: $interiorMargin;
                box-sizing: border-box;
				overflow: auto;
			}
		}
	}
}

.l-controls-first .form .form-row,
.form .form-row.l-controls-first {
    >.label,
    >.controls {
        line-height: inherit;
        min-height: inherit;;
    }
    >.label {
        @include flex(1 1 auto);
        min-width: 0;
        width: auto;
        order: 2;
    }
    >.controls {
        @include flex(0 0 auto);
        margin-right: $interiorMargin;
        order: 1;
    }
}

.l-controls-under.l-flex-row {
    // Change to use column layout
    @include flex-direction(column);
    .flex-elem {
        margin-bottom: $interiorMarginLg;
    }
}

.hint,
.s-hint {
	font-size: 0.9em;
    .req {
        color: $colorFormRequired;
        font-size: 0.7rem;
    }
}

.l-result {
	// Used in /vista/channel-query.html and evr-query.html as of 2/24/15
	display: inline-block;
	min-width: 32px; min-height: 32px;
	position: relative;
	vertical-align: top;

	div.s-hint {
		border-radius: $basicCr;
		background: rgba($colorFormInvalid, 0.8);
		display: block;
		color: lighten($colorFormInvalid, 30%);
		padding: $interiorMargin;
	}
}